import axios from '../utils/axios'

let getuserinfoData=()=>{
    let url = '/trains/user_info/'
    return axios.get(url)
}

let singinchange=()=>{
    let url = '/trains/sing_in/'
    return axios.post(url)
}

let getmyclassData=(page,page_size)=>{
    let url = '/trains/my_course/'
    return axios.get(url,{page,page_size})
}

let getmylikesData=(page,page_size)=>{
    let url = '/trains/my_teacher/'
    return axios.get(url,{page,page_size})
}

let getmystudyData=(page,page_size)=>{
    let url = '/trains/my_history_course/'
    return axios.get(url,{page,page_size})
}

let getmyrankData=(page,page_size)=>{
    let url = '/trains/ranking/'
    return axios.get(url,{page,page_size})
}

let getmytotalrankData=(page,page_size)=>{
    let url = '/trains/department_ranking/'
    return axios.get(url,{page,page_size})
}

let getdaylearnData=(date)=>{
    let url = '/trains/day_hour/'
    return axios.get(url,{date})
}

let getmonthlearnData=(date)=>{
    let url = '/trains/month_hour/'
    return axios.get(url,{date})
}

let getyearlearnData=(date)=>{
    let url = '/trains/year_hour/'
    return axios.get(url,{date})
}

let getdepartmentData=()=>{
    let url = '/trains/departments/'
    return axios.get(url)
}

let getallclassData=()=>{
    let url = '/trains/courses/'
    return axios.get(url)
}

let getalllessonData=(course_name)=>{
    let url = '/trains/lessons/'
    return axios.get(url,{course_name})
}

let searchData=(condition,page,page_size)=>{
    let url = '/trains/search/'
    return axios.get(url,{condition,page,page_size})
}

export{
    getuserinfoData,
    singinchange,
    getmyclassData,
    getmylikesData,
    getmystudyData,
    getmyrankData,
    getmytotalrankData,
    getdaylearnData,
    getmonthlearnData,
    getyearlearnData,
    getdepartmentData,
    getallclassData,
    getalllessonData,
    searchData
}